

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>KNX IoT testing &mdash; KNX IoT  documentation</title>
  

  
  <link rel="stylesheet" href="../_static/css/nordic.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/nordic.css" type="text/css" />
  <link rel="stylesheet" href="../_static/tabs.css" type="text/css" />

  
  

  
  

  

  
  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
  <script type="text/javascript" src="../_static/js/ncs.js"></script>

    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Case 1 - one button mapped to four LEDs" href="testing_cases/case_1.html" />
    <link rel="prev" title="KNX IoT Point API stack configuration" href="nordic_knxiot_cli.html" />
  <link rel="shortcut icon" href="../_static/images/favicon.ico"/>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> KNX IoT
          

          
          </a>

          
            
            
          

          
<div id="searchbox" role="search">
  <div class="searchformwrapper">
    <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
      <input type="text" name="q" placeholder="Search docs" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
  </div>
</div>
<script>$('#searchbox').show(0);</script>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">Subpages:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../about_knxiot.html">About KNX IoT Point API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../environment_setup.html">Requirements and setup</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="samples.html">Samples</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="samples_list.html">Samples building and running</a></li>
<li class="toctree-l2"><a class="reference internal" href="nordic_knxiot_cli.html">KNX IoT Point API stack configuration</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">KNX IoT testing</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#starting-thread-network">Starting Thread network</a></li>
<li class="toctree-l3"><a class="reference internal" href="#connecting-light-switch-sensor-to-light-switch-actuator">Connecting Light Switch Sensor to Light Switch Actuator</a></li>
<li class="toctree-l3"><a class="reference internal" href="#location-of-leds-and-buttons">Location of LEDs and buttons</a></li>
<li class="toctree-l3"><a class="reference internal" href="#sniffing-knx-iot-point-api-communication">Sniffing KNX IoT Point API communication</a></li>
<li class="toctree-l3"><a class="reference internal" href="#sample-cases">Sample cases</a><ul>
<li class="toctree-l4"><a class="reference internal" href="testing_cases/case_1.html">Case 1 - one button mapped to four LEDs</a></li>
<li class="toctree-l4"><a class="reference internal" href="testing_cases/case_2.html">Case 2 - one button mapped to one LED</a></li>
<li class="toctree-l4"><a class="reference internal" href="testing_cases/case_3.html">Case 3 - mixed configuration</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../knxiot_release_notes.html">Release notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../knxiot_known_issues.html">Known issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../additional_resources.html">Additional resources</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">KNX IoT</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="samples.html">Samples</a> &raquo;</li>
        
      <li>KNX IoT testing</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../_sources/testing_samples/knxiot_testing.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="knx-iot-testing">
<span id="knxiot-testing"></span><h1>KNX IoT testing<a class="headerlink" href="#knx-iot-testing" title="Permalink to this heading">¶</a></h1>
<p>With the <a class="reference internal" href="knxiot_application_samples/light_switch_actuator.html#light-switch-actuator"><span class="std std-ref">Light Switch Actuator</span></a> and <a class="reference internal" href="knxiot_application_samples/light_switch_sensor.html#light-switch-sensor"><span class="std std-ref">Light Switch Sensor</span></a> installed, you will be able to test a simple KNX IoT system consisted of two Thread-based devices.</p>
<div class="section" id="starting-thread-network">
<span id="id1"></span><h2>Starting Thread network<a class="headerlink" href="#starting-thread-network" title="Permalink to this heading">¶</a></h2>
<p>The devices enable the Thread interface during startup automatically.
They are configured to create and join Thread network with the following parameters:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Parameter</p></th>
<th class="head"><p>Value</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>PAN ID</p></td>
<td><p>0xabcd</p></td>
</tr>
<tr class="row-odd"><td><p>Channel</p></td>
<td><p>11</p></td>
</tr>
<tr class="row-even"><td><p>Network name</p></td>
<td><p>KNX</p></td>
</tr>
<tr class="row-odd"><td><p>Extended PAN ID</p></td>
<td><p>dead00beef00cafe</p></td>
</tr>
<tr class="row-even"><td><p>Network key</p></td>
<td><p>00112233445566778899aabbccddeeff</p></td>
</tr>
</tbody>
</table>
<p>To verify Thread devices status, do the following:</p>
<ol class="arabic">
<li><p>Check active data.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">uart:~$ </span>ot<span class="w"> </span>dataset<span class="w"> </span>active
<span class="go">Active Timestamp: 1</span>
<span class="go">Channel: 15</span>
<span class="go">Channel Mask: 0x07fff800</span>
<span class="go">Ext PAN ID: 3b78ce629cbc8e23</span>
<span class="go">Mesh Local Prefix: fdd7:9fa0:468:ba1b::/64</span>
<span class="go">Network Key: 00112233445566778899aabbccddeeff</span>
<span class="go">Network Name: OpenThread-7cf7</span>
<span class="go">PAN ID: 0x7cf7</span>
<span class="go">PSKc: b2e04e90cef89d25981a7dd8f3c16db5</span>
<span class="go">Security Policy: 672 onrc</span>
<span class="go">Done</span>
</pre></div>
</div>
</li>
<li><p>Verify devices’ roles.</p></li>
</ol>
<blockquote>
<div><ul>
<li><p>Check if one of devices is set as a Thread leader.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">uart:~$ </span>ot<span class="w"> </span>state
<span class="go">leader</span>
<span class="go">Done</span>
</pre></div>
</div>
</li>
<li><p>Check if another device is either a Thread child or leader:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">uart:~$ </span>ot<span class="w"> </span>state
<span class="go">child</span>
<span class="go">Done</span>
</pre></div>
</div>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">uart:~$ </span>ot<span class="w"> </span>state
<span class="go">leader</span>
<span class="go">Done</span>
</pre></div>
</div>
</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="connecting-light-switch-sensor-to-light-switch-actuator">
<h2>Connecting Light Switch Sensor to Light Switch Actuator<a class="headerlink" href="#connecting-light-switch-sensor-to-light-switch-actuator" title="Permalink to this heading">¶</a></h2>
<p>KNX IoT devices, just as the classic KNX devices, consist of one or many Functional Blocks.
Functional Block contains one or more Datapoints which are its inputs, outputs, and parameters.</p>
<p>The most important feature of Datapoint’s description is its type.
The type specifies how the Datapoint is encoded, its supported range, units, an so on.
All Datapoints of a given Functional Block and featured types are described in the <a class="reference external" href="https://www.knx.org/wAssets/docs/downloads/Certification/Interworking-Datapoint-types/03_07_02-Datapoint-Types-v02.02.01-AS.pdf">KNX Specification</a> page.</p>
<p>Both Light Switch Actuator and Sensor - depending on the boards used - are built with 1, 3, or 4 Functional Blocks with a single Switch On/Off Datapoint (type name: DPT_Switch, id: 1.001).
Every Datapoint either controls a single LED (Actuator) or is controlled by a single button (Sensor).
For communication between KNX IoT Point API, devices send s-mode messages over the CoAP protocol.
A board that is the recipient of the s-mode message checks its Group Object Table to confirm if the message can be processed.</p>
<p>The following tables present configuration of Datapoints for Light Switch Actuator and Light Switch Sensor devices:</p>
<ul>
<li><p>Light Switch Actuator Datapoints:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 13%" />
<col style="width: 9%" />
<col style="width: 9%" />
<col style="width: 54%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>LED</p></th>
<th class="head"><p>Path</p></th>
<th class="head"><p>GET</p></th>
<th class="head"><p>SET</p></th>
<th class="head"><p>Comment</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>LED1</p></td>
<td><p>/p/1</p></td>
<td><p>Yes</p></td>
<td><p>Yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>LED2</p></td>
<td><p>/p/2</p></td>
<td><p>Yes</p></td>
<td><p>Yes</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>LED3</p></td>
<td><p>/p/3</p></td>
<td><p>Yes</p></td>
<td><p>Yes</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>LED4</p></td>
<td><p>/p/4</p></td>
<td><p>Yes</p></td>
<td><p>Yes</p></td>
<td><p>Not available for Thingy:53</p></td>
</tr>
</tbody>
</table>
</li>
<li><p>Light Switch Sensor Datapoints:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 13%" />
<col style="width: 9%" />
<col style="width: 9%" />
<col style="width: 52%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Button</p></th>
<th class="head"><p>Path</p></th>
<th class="head"><p>GET</p></th>
<th class="head"><p>SET</p></th>
<th class="head"><p>Comment</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>BUTTON1</p></td>
<td><p>/p/1</p></td>
<td><p>Yes</p></td>
<td><p>No</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>BUTTON2</p></td>
<td><p>/p/2</p></td>
<td><p>Yes</p></td>
<td><p>No</p></td>
<td><p>Not available for Thingy:53</p></td>
</tr>
<tr class="row-even"><td><p>BUTTON3</p></td>
<td><p>/p/3</p></td>
<td><p>Yes</p></td>
<td><p>No</p></td>
<td><p>Not available for Thingy:53</p></td>
</tr>
<tr class="row-odd"><td><p>BUTTON4</p></td>
<td><p>/p/4</p></td>
<td><p>Yes</p></td>
<td><p>No</p></td>
<td><p>Not available for Thingy:53</p></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<div class="section" id="location-of-leds-and-buttons">
<h2>Location of LEDs and buttons<a class="headerlink" href="#location-of-leds-and-buttons" title="Permalink to this heading">¶</a></h2>
<p>Pictures below present locations of LEDs (yellow rectangles) and buttons (green rectangles) used in the samples.</p>
<blockquote>
<div><div class="figure align-default" id="id2">
<img alt="../_images/dk_leds_and_buttons_nrf52840dk.png" src="../_images/dk_leds_and_buttons_nrf52840dk.png" />
<p class="caption"><span class="caption-text">Image: Location of LEDs (yellow rectangle) and buttons (green rectangle) of nRF52840 DK.</span><a class="headerlink" href="#id2" title="Permalink to this image">¶</a></p>
</div>
<div class="figure align-default" id="id3">
<img alt="../_images/dk_leds_and_buttons_nrf5340dk.png" src="../_images/dk_leds_and_buttons_nrf5340dk.png" />
<p class="caption"><span class="caption-text">Image: Location of LEDs (yellow rectangle) and buttons (green rectangle) of nRF5340 DK.</span><a class="headerlink" href="#id3" title="Permalink to this image">¶</a></p>
</div>
<div class="figure align-default" id="id4">
<img alt="../_images/dk_leds_and_buttons_thingy53.png" src="../_images/dk_leds_and_buttons_thingy53.png" />
<p class="caption"><span class="caption-text">Image: Location of RGB LEDs (yellow rectangle) and the button (green rectangle) of Thingy:53.</span><a class="headerlink" href="#id4" title="Permalink to this image">¶</a></p>
</div>
</div></blockquote>
</div>
<div class="section" id="sniffing-knx-iot-point-api-communication">
<h2>Sniffing KNX IoT Point API communication<a class="headerlink" href="#sniffing-knx-iot-point-api-communication" title="Permalink to this heading">¶</a></h2>
<p>In order to inspect the packets exchanged between KNX devices, the 802.15.4 sniffer can be used.
To capture CoAP messages sent through a default port (5683), set up the Wireshark as described in <a class="reference internal" href="../environment_setup.html#sniffer-configuration"><span class="std std-ref">sniffer configuration</span></a> with regard to default configuration specified in the <a class="reference internal" href="#starting-thread-network"><span class="std std-ref">Starting Thread Network</span></a> section.</p>
<div class="figure align-default" id="id5">
<img alt="../_images/example_capture.png" src="../_images/example_capture.png" />
<p class="caption"><span class="caption-text">Figure: Capture of CoAP messages.</span><a class="headerlink" href="#id5" title="Permalink to this image">¶</a></p>
</div>
<div class="figure align-default" id="id6">
<img alt="../_images/example_coap_packet.png" src="../_images/example_coap_packet.png" />
<p class="caption"><span class="caption-text">Figure: Content of CoAP message.</span><a class="headerlink" href="#id6" title="Permalink to this image">¶</a></p>
</div>
</div>
<div class="section" id="sample-cases">
<h2>Sample cases<a class="headerlink" href="#sample-cases" title="Permalink to this heading">¶</a></h2>
<p>Configure Actuators and Sensors based on the following cases:</p>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Subpages:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="testing_cases/case_1.html">Case 1 - one button mapped to four LEDs</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing_cases/case_2.html">Case 2 - one button mapped to one LED</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing_cases/case_3.html">Case 3 - mixed configuration</a></li>
</ul>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="testing_cases/case_1.html" class="btn btn-neutral float-right" title="Case 1 - one button mapped to four LEDs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="nordic_knxiot_cli.html" class="btn btn-neutral" title="KNX IoT Point API stack configuration" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">

<table>
<tr>
<td>
    <p>
        &copy; Copyright 2023, Nordic Semiconductor.

    </p>
</td>
<td id="nordiclogo">
  <a href="https://www.nordicsemi.com/"><img src="../_static/images/nordic.svg" border="0"/></a>
</td>
</tr>
</table>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 


</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>